home *** CD-ROM | disk | FTP | other *** search
/ Mac Magazin/MacEasy 32 / Mac Magazin and MacEasy Magazine CD - Issue 32.iso / Multimedia / PlayerPRO 4.5.5 Dev.Kit / Plug-Ins / Music Import⁄Export Plugs / x86⁄Win32 DLL.c < prev   
Text File  |  1997-02-25  |  2KB  |  56 lines

  1. /*     
  2.     This is a basic win32 DLL.
  3.     Although not required, this DLL has a DllMain() entry/exit function, which is used when
  4.     any per-process or per-thread initialization (such as memory allocation/release) has to
  5.     be performed.
  6.     
  7.     Exporting DLL functions is accomplished here with the use of the __declspec(dllexport)
  8.     storage class specifier; this prompts the linker to generate a stub file with a .dll.lib
  9.     extension that must be included in the project for the application that uses the DLL.
  10.     
  11.     Importing the functions in the DLL's host application is accomplished by simply declaring
  12.     them as extern, or with the __declspec(dllimport) storage class specifier (The latter 
  13.     method is preferred, since it allows slightly more efficient code to be produced.
  14.     (More information on DLL's can be found in "Advanced Windows: The Developer's Guide
  15.     to the Win32 API for Windows NT 3.5 and Windows 95", by Jeffrey Richter and "Programming
  16.     Windows 95", by Charles Petzold)
  17.     
  18.     Lucien S.
  19.     Metrowerks Tech. Support.
  20. */
  21. #include <windows.h>
  22. #include <stdio.h>
  23. #define EXP __declspec(dllexport)
  24.  
  25. BOOL WINAPI DllMain ( HINSTANCE hInst, DWORD wDataSeg, LPVOID lpvReserved );
  26.  
  27. EXP int RectFrame(HDC hdc, int x1, int y1, int x2, int y2, int t);
  28. EXP int EllipseFrame(HDC hdc, int x1, int y1, int x2, int y2, int t);
  29.  
  30.                     
  31. BOOL WINAPI DllMain( HINSTANCE hInst, DWORD wDataSeg, LPVOID lpReserved )
  32. {
  33.     switch(wDataSeg)
  34.     {
  35.         case DLL_PROCESS_ATTACH:
  36.         /*    MessageBox ( GetFocus(),
  37.                   "attaching",
  38.                   "Process attaching to MOD.dll...",
  39.                   MB_OK|MB_SYSTEMMODAL );*/
  40.               return 1;
  41.               break;
  42.         case DLL_PROCESS_DETACH:
  43.         /*    MessageBox ( GetFocus(),
  44.                   "detaching",
  45.                   "Process detaching from MOD.dll...",
  46.                   MB_OK|MB_SYSTEMMODAL );*/
  47.             return 1;
  48.             break;
  49.  
  50.           default:
  51.               return 1;
  52.               break;
  53.        }
  54.        
  55.        return 0;
  56. }